-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scc 4345/add record type #422
Conversation
lib/jsonld_serializers.js
Outdated
@@ -280,6 +286,13 @@ class ResourceSerializer extends JsonLdItemSerializer { | |||
} | |||
} | |||
|
|||
ResourceSerializer.getFormattedRecordType = function (recordTypeId) { | |||
return { | |||
'@id': 'recordType:' + recordTypeId, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need the recordType:
namespace here. 1) it's not a namespace we define anywhere, and 2) we're don't appear to be doing the same thing in the aggregation. So just drop the recordType:
?
Alternatively, to make this more consistent and json-ld-ish:
- add same namespace to the recordType aggregation values
- ensure that when
?filters[recordType]=
is used, we allow the namespace to be optionally used in ids, i.e. stripped, so that front-end doesn't need to remove it when filtering - add namespace definition to relevant context file (
"recordType": "nypl:recordType"
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i opt for the first! makes sense.
lib/jsonld_serializers.js
Outdated
@@ -485,6 +498,10 @@ class AggregationSerializer extends JsonLdItemSerializer { | |||
} else if (field === 'buildingLocation') { | |||
// Build buildingLocation agg labels from nypl-core: | |||
v.label = locations[v.value]?.label | |||
} else if (field === 'recordType') { | |||
console.log(v) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove
recordType
with json LD namespace and nypl core label to resources bib responserecordType
to filtersrecrodType
to search aggregations